#pragma once

#include "Nod.h"
#include "Constants.h"

using namespace Constants;

class FiguraFactory
{
public:
	static Figure* CreateFigure(EDrawState drawState, const CRect& drawArea, CPoint startP = CPoint(0,0), int radius = 25)
	{
		switch (drawState)
		{
		case NOD:
            {
                if (startP.x - radius < 0 || startP.x + radius > drawArea.right)
                    radius = startP.x;
                if (startP.x + radius > drawArea.right)
                    radius = drawArea.right - startP.x;
                if (startP.y - radius < 0) 
                    radius = 0;
                if (startP.y + radius > drawArea.bottom)
                    radius = drawArea.bottom - startP.y;
                if (radius > 4)
				    return new Nod(startP,radius);
                break;
            }
		case MUCHIE:
			break;
        default:
            return NULL;
		}
	}
};

